<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const num = 10;
    /*输出语法*/
    console.log(num)
    document.write(`<h1>${num}</h1>`)
    alert(num)

    /*输入语法*/
    const res = prompt("请输入两个个字符")
    // 判断预计
    if (res.length === 2) {
        document.write(res)
    } else {
        document.write("只能输入两个字符")
    }
</script>
</body>
</html>